package cn.tedu.online.day01;

public class Recursion {
    public static void main(String[] args) {
//        System.out.println("请输入一个正整数");
//        Scanner scanner = new Scanner(System.in);
//        int n = scanner.nextInt();


        /*long result = f(n);
        System.out.println(result);*/

        for (int i=1; i<=30;i++) {
            System.out.print(c(i)+" ");
        }
    }

    //递归
    public static long f(int n){
        if (n==1)
            return 1;
        return n*f(n-1);
    }

    //斐波那契数列
    public static long c(int n){
        if (n==1 || n==2)
            return 1;
        return c(n-1)+c(n-2);
    }
}
